<?php
	session_start();
	require_once('WKIMG.php');
	$pdf = new WKIMG();
	$html = $_POST['html'];
	$filename = $_POST['filename'];
	$pdf->set_html($html);
	$pdf->render();
	if (isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'share')	{
		include('plugin/share.php');
		$plugin = new SharePlugin($pdf);
		$plugin->execute();
	} else	{
		$pdf->output('D',$filename.'.jpg');
		print $html;
	} 
?>
